//
//  UIViewController+TYPadSupport.m
//  TYUIKit
//
//  Created by caojw on 2021/8/11.
//

#import "UIViewController+TYPadSupport.h"
#import "UIDevice+TYSystemInfo.h"

@implementation UIViewController (TYPadSupport)

- (UIInterfaceOrientationMask)ty_interfaceOrientationMask {
    return TY_IsPad() ? UIInterfaceOrientationMaskLandscape : UIInterfaceOrientationMaskPortrait;
}

- (UIInterfaceOrientation)ty_interfaceOrientationForPresentation {
    //为了兼容pad相机转向问题
    UIInterfaceOrientation interfaceOrientation = [[UIApplication sharedApplication] statusBarOrientation];
    if (!UIInterfaceOrientationIsLandscape(interfaceOrientation)) {
        interfaceOrientation = UIInterfaceOrientationLandscapeRight;
    }
    return TY_IsPad() ? interfaceOrientation : UIInterfaceOrientationPortrait;
}


@end
